<template>
  <div class="permission-demo">
    <el-menu
      default-active="1"
      text-color="#fff"
      active-text-color="#409eff"
      background-color="#222832"
    >
      <el-menu-item index="1" v-permission="'ControlPanel'">
        <i class="el-icon-menu"></i>
        <span slot="title">控制面板</span>
      </el-menu-item>

      <el-submenu index="2">
        <template #title>
          <i class="el-icon-s-tools"></i>
          <span>主页配置</span>
        </template>
        <el-menu-item index="2-1" v-permission="'BannerSetting'">
          <i class="el-icon-picture-outline"></i>
          <span slot="title">轮播图</span>
        </el-menu-item>
        <el-menu-item index="2-2" v-permission="'GoodsSetting'">
          <i class="el-icon-wallet"></i>
          <span slot="title">热销商品</span>
        </el-menu-item>
        <el-menu-item index="2-3" v-permission="'ProductSetting'">
          <i class="el-icon-position"></i>
          <span slot="title">新品上线</span>
        </el-menu-item>
        <el-menu-item index="2-4" v-permission="'RecommendSetting'">
          <i class="el-icon-thumb"></i>
          <span slot="title">为你推荐</span>
        </el-menu-item>
      </el-submenu>

      <el-menu-item index="3" v-permission="'ClassiFication'">
        <i class="el-icon-tickets"></i>
        <span slot="title">分类管理</span>
      </el-menu-item>

      <el-menu-item index="4" v-permission="'GoodsManager'">
        <i class="el-icon-shopping-cart-full"></i>
        <span slot="title">商品管理</span>
      </el-menu-item>

      <el-menu-item index="5" v-permission="'MemberManager'">
        <i class="el-icon-user"></i>
        <span slot="title">会员管理</span>
      </el-menu-item>

      <el-menu-item index="6" v-permission="'OrderManager'">
        <i class="el-icon-s-order"></i>
        <span slot="title">订单管理</span>
      </el-menu-item>

      <el-menu-item index="7" v-permission="'SystemSetting'">
        <i class="el-icon-setting"></i>
        <span slot="title">系统设置</span>
      </el-menu-item>
    </el-menu>
  </div>
</template>

<script>
export default {
  name: 'permission-demo'
}
</script>

<style lang="less" scoped>
.el-menu {
  border-right: none;
}
</style>
